package com.itic.web.util;

import java.util.Random;

public class HexText {
	
	static void t16(){  
		byte[] src = new byte[1024];  
		new Random().nextBytes(src);  
		byte[] digest = Toolkit.digest(src,0,src.length);  
//	       digest[3]='2';  
		System.out.println(Toolkit.checkDigest(digest, src,0,src.length));  
	}  
	
	static void t15(){  
		byte[] src = new byte[10];  
		new Random().nextBytes(src);  
//	       byte[] src = "12345qwert".getBytes();  
		for(byte b: src){  
			System.out.print((byte)b+" ");  
		}  
		System.out.println("----src---");  
		String hex = Toolkit.bytes2Hex(src);  
		System.out.println(hex);  
		
		src = Toolkit.hex2Bytes1(hex);  
		for(byte b: src){  
			System.out.print(b+" ");  
		}  
		System.out.println("----src---");  
		hex = Toolkit.bytes2Hex(src);  
		System.out.println(hex);  
		
		src = Toolkit.hex2Bytes1(hex);  
		for(byte b: src){  
			System.out.print(b+" ");  
		}  
		System.out.println("----src---");  
	}
	
	public static void main(String[] args) {
		//t16();
		t15();
	}

}
